export function formatTime(timestamp, format = 'yyyy/MM/dd hh:mm:ss') {
  const date = new Date(timestamp);
  const padZero = num => num.toString().padStart(2, '0');
  
  const replacements = {
    'yyyy': date.getFullYear(),
    'MM': padZero(date.getMonth() + 1),
    'dd': padZero(date.getDate()),
    'hh': padZero(date.getHours()),
    'mm': padZero(date.getMinutes()),
    'ss': padZero(date.getSeconds())
  };
  
  return Object.entries(replacements).reduce(
    (str, [key, value]) => str.replace(key, value), 
    format
  );
}